<template>
  <div class="container">
    <global-header :user="currentUser" />
    <router-view />
    <footer class="text-center py-4 text-secondary bg-light mt-6">
      <small>
        <ul class="list-inline mb-0">
          <li class="list-inline-item">©️ {{ curYear }} 知也专栏</li>
          <li class="list-inline-item">课程</li>
          <li class="list-inline-item">文档</li>
          <li class="list-inline-item">联系</li>
          <li class="list-inline-item">更多</li>
        </ul>
      </small>
    </footer>
  </div>
</template>

<script setup lang="ts">
import { computed } from "vue";
import { useRouter } from "vue-router";
import GlobalHeader from "@/components/GlobalHeader.vue";
import { UserProps, useStore } from "@/store/index";
import "bootstrap/dist/css/bootstrap.min.css";

const store = useStore();
const router = useRouter();
const curYear = computed(() => new Date().getFullYear());
const currentUser = computed<UserProps>(() => store.state.user);

store.dispatch("getCurrentUser", { router });
</script>
